package com.polymathcoder.dpastry.api.environment;

import org.slf4j.Logger;

/**
 * Created by IntelliJ IDEA.
 * User: Drew
 * Date: Jul 5, 2010
 * Time: 11:36:27 AM
 * To change this template use File | Settings | File Templates.
 */
public interface Environment {
    public void shutdown();

    // ************** ENVIRONMENT SHOULD PROVIDE ACCESS TO SLF4J LOGGER **************

    /**
     * Returns a SLF4J logger corresponding to the given class
     *
     * @param clazz the class on which to bind the logger
     * @return the logger corresponding to the given class
     */
    public Logger getLogger(Class clazz);

    /**
     * Returns a SLF4J logger corresponding to the given String name
     *
     * @param name the name on which to bind the logger
     * @return the logger corresponding to the given name
     */
    public Logger getLogger(String name);

    // ************** ENVIRONMENT SHOULD PROVIDE TASK PROCESSORS **************

    public FlexProcessor processingPool();

    // ************** ENVIRONMENT SHOULD PROVIDE AN I/O TASK PROCESSOR **************

    public FlexProcessor secondaryPool();

    // ************** ENVIRONMENT CAN PROVIDE ITS OWN TIME SOURCE **************

    public TimeSource time();

    // ************** ENVIRONMENT CAN PROVIDE ITS OWN RANDOM GENERATOR **************

    public RandomSource random();
}
